package com.kbt.util.tool;

import com.readystatesoftware.viewbadger.BadgeView;

/**
 * Created by Administrator on 2015/8/7.
 */
public class CarCountBadgeUtil {
    public static void setCarBadge(BadgeView badgeView,int count){
        String oldStr = badgeView.getText().toString();
        int oldCount = 0;
        if(oldStr != null && oldStr.trim().length()>0){
            oldCount = Integer.parseInt(oldStr);
        }
        int nowCount = oldCount+count;
        if(nowCount > 0){
            badgeView.setText(String.valueOf(nowCount));
            badgeView.show();
        }else{
            badgeView.setText("");
            badgeView.hide();
        }


    }
}
